package nero.yncc.com.createart.utils;

import java.util.List;

/**
 * Created by nero on 17-6-28.
 */

public class ArrayUtils {

    public static <T> void copy(List<T> source, List<T> desc, boolean cleaner) {
        if (cleaner)
            desc.clear();
        for (T t : source) {
            desc.add(t);
        }
    }

    public static <T> void copy(List<T> source, List<T> desc, int num, boolean cleaner) {
        int numcache = 0;
        if (cleaner)
            desc.clear();
        for (T t : source) {
            desc.add(t);
            numcache++;
            if (num == numcache) {
                break;
            }
        }
    }
}
